/*
 * @Description: 
 * @Autor: Zhongyu
 * @Date: 2021-03-12 10:10:42
 * @LastEditors: Zhongyu
 * @LastEditTime: 2021-03-18 15:58:33
 */
import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '../views/home';
import User from '../views/user';
import Departments from '../views/departments';
import Roles from '../views/roles';
import LimitsDatas from '../views/limits/datas';
import LimitsMenus from '../views/limits/menus';

Vue.use(VueRouter);

const routes = [
	{
		path: '/',
		redirect: '/home',
	},
	{
		path: '/home',
		name: 'Home',
		component: Home,
	},
	{
		path: '/users',
		name: 'User',
		component: User,
	},
	{
		path: '/departments',
		name: 'Departments',
		component: Departments,
	},
	{
		path: '/roles',
		name: 'Roles',
		component: Roles,
	},
	{
		path: '/limits/datas',
		name: 'LimitsDatas',
		component: LimitsDatas,
	},
	{
		path: '/limits/menus',
		name: 'LimitsMenus',
		component: LimitsMenus,
	},
    {
		path: '*',
		redirect: '/home',
	},
];

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes,
});

export default router;
